package com.lkd.shoppingcart.entity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品
 * @author shubing
 *
 */
public class Product {
	
	private Integer id;
	private String name;
	private BigDecimal price;
	private Integer counts;
	private Integer sales;
	private String productor;
	private String imgPath = "static/img/xiaomi11.jpg";
	private Date crtTime;
	
	public Product() {
		super();
	}
	
	public Product(Integer id, String name, BigDecimal price, Integer counts, Integer sales, String productor,
			String imgPath, Date crtTime) {
		super();
		this.id = id;
		this.name = name;
		this.price = price;
		this.counts = counts;
		this.sales = sales;
		this.productor = productor;
		
		// 要求给定的商品封面路径不能为空
        if (imgPath != null && !"".equals(imgPath)) {
            this.imgPath = imgPath;
        }
		
		this.crtTime = crtTime;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Integer getCounts() {
		return counts;
	}

	public void setCounts(Integer counts) {
		this.counts = counts;
	}

	public Integer getSales() {
		return sales;
	}

	public void setSales(Integer sales) {
		this.sales = sales;
	}

	public String getProductor() {
		return productor;
	}

	public void setProductor(String productor) {
		this.productor = productor;
	}

	public String getImgPath() {
		return imgPath;
	}

	public void setImgPath(String imgPath) {
		// 要求给定的商品封面路径不能为空
        if (imgPath != null && !"".equals(imgPath)) {
            this.imgPath = imgPath;
        }
	}

	public Date getCrtTime() {
		return crtTime;
	}

	public void setCrtTime(Date crtTime) {
		this.crtTime = crtTime;
	}

	@Override
	public String toString() {
		return "Product [id=" + id + ", name=" + name + ", price=" + price + ", counts=" + counts + ", sales=" + sales
				+ ", productor=" + productor + ", imgPath=" + imgPath + ", crtTime=" + crtTime + "]";
	}

}
